package com.neuedu.elmserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neuedu.elmserver.mapper.FeaturedFoodsMapper;
import com.neuedu.elmserver.mapper.RecipesMapper;
import com.neuedu.elmserver.pojo.FeaturedFoods;
import com.neuedu.elmserver.pojo.Recipes;
import com.neuedu.elmserver.service.FeaturedFoodsService;
import com.neuedu.elmserver.service.RecipesService;
import com.neuedu.elmserver.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*package com.neuedu.elmserver.service.impl;

import com.neuedu.elmserver.mapper.FeaturedFoodsMapper;
import com.neuedu.elmserver.pojo.FeaturedFoods;
import com.neuedu.elmserver.service.FeaturedFoodsService;
import com.neuedu.elmserver.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class FeaturedFoodsServiceImpl implements FeaturedFoodsService {

    private final FeaturedFoodsMapper featuredFoodsMapper;

    @Autowired
    public FeaturedFoodsServiceImpl(FeaturedFoodsMapper featuredFoodsMapper) {
        this.featuredFoodsMapper = featuredFoodsMapper;
    }

    @Override
    public ResultVO<List<FeaturedFoods>> getFeaturedFoodsList() {
        try {
            List<FeaturedFoods> featuredFoodsList = featuredFoodsMapper.selectList(null);
            if (featuredFoodsList!= null &&!featuredFoodsList.isEmpty()) {
                return ResultVO.ok("查询成功",featuredFoodsList);
            }
            return ResultVO.fail("未查询到特色美食信息");
        } catch (Exception e) {
            e.printStackTrace();
            return ResultVO.fail("获取特色美食列表出现异常");
        }
    }
}*/
@Service

public class FeaturedFoodsServiceImpl extends ServiceImpl<FeaturedFoodsMapper, FeaturedFoods> implements FeaturedFoodsService {

    @Autowired
    private FeaturedFoodsMapper featuredFoodsMapper;


    /**
     * 根据level编号查询食品列表
     *
     * @param
     * @return
     */
    @Override
    public ResultVO queryFeaturedFoodsList() {
        QueryWrapper qw = new QueryWrapper();
        List<FeaturedFoods> FeaturedFoodsList = featuredFoodsMapper.selectList(qw);

        return ResultVO.ok("查询成功", FeaturedFoodsList);


    }
}


